Paul Fox improves stability of sort filter.
authorrobertl <robertl>
Tue, 22 Aug 2006 15:39:25 +0000 (15:39 +0000)
committerrobertl <robertl>
Tue, 22 Aug 2006 15:39:25 +0000 (15:39 +0000)
sort.c

diff --git a/sort.c b/sort.c
index 0c14e2c5748a111061acd5762f7d3c026991a3e4..b7e57943152545ab658ecd5ad71140b270b62ff5 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -55,10 +55,10 @@ sort_comp(const void * a, const void * b)
        const waypoint *x2 = *(waypoint **)b;
 
        switch (sort_mode)  {
-          case sm_gcid: return x1->gc_data.id > x2->gc_data.id;
+          case sm_gcid: return x1->gc_data.id - x2->gc_data.id;
           case sm_shortname: return strcmp (x1->shortname, x2->shortname);
           case sm_description: return strcmp (x1->description, x2->description);
-          case sm_time: return x1->creation_time > x2->creation_time;
+          case sm_time: return x1->creation_time - x2->creation_time;
           default: abort(); return 0; /* Internal caller error. */
        }
 }